<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 画布元素 -->
    <canvas id="canvas"></canvas>
</body>
<script>
    var canvas=document.getElementById('canvas')
    if(canvas.getContext){
        var ctx=canvas.getContext('2d')
        ctx.flllRect(25,25,100,100);
        ctx.fillStyle='red'
        ctx.clearRect(45,45,60,60)
        ctx.strokeRect(50,50,50,50)
    }
</script>
</html>